#99乘法表练习for循环 正三角
for i in range(1,10):
	for j in range(1,i+1):
		print('{}*{}={} '.format(j,i,i*j),end = '')
	print('')

#99乘法表for循环 倒三角
for i in range(9,0,-1):
	for j in range(1,i+1):
		print('{}*{}={} '.format(j,i,i*j),end = '')
	print('')

# for 循环正三角 右对齐
for i in range(1,10):
	for k in range(1,10-i):
		print(end='       ')#使用空格表示公式占位数
	for j in range(i,0,-1):
		print('%d*%d=%2d '%(j,i,i*j),end = '')#百分号占位
	print('')

#for循环倒三角 右对齐
for i in range(9,0,-1):
	for k in range(1,10-i):
		print(end='       ')
	for j in range(i,0,-1):
		print('%d*%d=%2d '%(j,i,i*j),end = '')
	print('')


#99乘法表输出while循环，正三角
i = 1
while i < 10:#下面都是包括在while循环里的
	j = 1
	while  j < i+1:
		print('{}*{}={} '.format(j,i,i*j),end = '')
		j = j + 1
	print('')
	i = i + 1

# while 循环输出 倒三角
i = 9
while i > 0:
	j = 1
	while j < i + 1:
		print('{}*{}={} '.format(j,i,i*j),end = '')
		j = j + 1
	print('')
	i = i - 1
# while 循环输出正三角右对齐
i = 1
while i < 10 :#下面都是包括在while循环里的
	k = 1
	while k < 10 - i :
		print(end='       ')
		k = k + 1
	j = i # 此时j应该倒序遍历
	while  j > 0:
		print('%d*%d=%2d '%(i,j,i*j),end = '')
		j = j - 1
	print('')
	i = i + 1
# while 循环输出倒三角右对齐
i = 9
while i > 0 : 
	k = 1
	while k < 10 - i :
		print(end='       ')
		k = k + 1
	j = i
	while j > 0 :
		print('%d*%d=%2d '%(j,i,i*j),end = '')
		j = j - 1
	print('')
	i = i - 1

# 自动取款机作业练习